import React,{useEffect} from 'react'
import {useNavigate} from "react-router-dom"
export default function useErrorMessage() {
    const navigate = useNavigate();
    const handleTokenError = ()=>{
        navigate("/login");
        localStorage.removeItem("token");
        window.$message.error("token已过期,请重新登录");
    }
  return {handleTokenError};
}
